//
//  UIStyleMacro.h
//  SheMeasured
//
//  Created by yqh on 2019/4/14.
//  Copyright © 2019年 xmddkj. All rights reserved.
//

#ifndef UIStyleMacro_h
#define UIStyleMacro_h

#define WEAKSELF  __weak typeof(self) weakSelf = self;

//颜色
#define RGB(r, g, b)       [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define RGBA(r, g, b, a)   [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a/1.0]
#define RGBSAME(s)         RGB(s, s, s)

//长度宽度比例
#define SCREEN_WIDTH                    [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT                   [UIScreen mainScreen].bounds.size.height
#define SCREEN_RATIO                    (SCREEN_WIDTH/375.0)
#define kRatio(r)                       (SCREEN_RATIO * r)

#define NavStatus_Height                [[UIApplication sharedApplication] statusBarFrame].size.height
#define NavBarTitle_Height              44
#define NavBar_Height                   (NavStatus_Height + NavBarTitle_Height)

#define TabBarItem_Height               49
#define TabBarExt_Height                (IS_PhoneXAll ? 34 : 0)
#define TabBar_Height                   (TabBarItem_Height + TabBarExt_Height)

#define SafeArea_Height                 (SCREEN_HEIGHT - NavStatus_Height - TabBarExt_Height)
#define Bar_Height                      (NavBar_Height + TabBar_Height)





//平方-简 常规体
#define UIFont_PingFang_Regular(fontSize) [UIFont fontWithName:@".PingFangSC-Regular" size:fontSize]
//平方-简 极细体
#define UIFont_PingFang_Ultralight(fontSize) [UIFont fontWithName:@".PingFangSC-Ultralight" size:fontSize]
//平方-简 细体
#define UIFont_PingFang_Light(fontSize) [UIFont fontWithName:@".PingFangSC-Light" size:fontSize]
//平方-简 纤细体
#define UIFont_PingFang_Thin(fontSize) [UIFont fontWithName:@".PingFangSC-Thin" size:fontSize]
//平方-简 中黑体
#define UIFont_PingFang_Medium(fontSize) [UIFont fontWithName:@".PingFangSC-Medium" size:fontSize]
//平方-简 中粗体
#define UIFont_PingFang_Bold(fontSize) [UIFont fontWithName:@".PingFangSC-Semibold" size:fontSize]
//系统字体 常规体
#define FONTSIZE(f) [UIFont systemFontOfSize:f]
//系统字体 粗体
#define BFONTSIZE(f) [UIFont boldSystemFontOfSize:f]





//判断Iphone设配
#define IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
//判断iPhone4系列
#define IS_IPHONE4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhone5系列
#define IS_IPHONE5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhone6 6s 7系列
#define IS_IPHONE6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhone6p 6sp 7p系列
#define IS_IPHONE6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhoneX，Xs（iPhoneX，iPhoneXs）
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
//判断iPhoneXsMax
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size)&& !IS_IPAD : NO)
//判读是否有安全区域的机型
#define IS_PhoneXAll (IS_IPHONE_X || IS_IPHONE_Xr || IS_IPHONE_Xs_Max)






#endif /* UIStyleMacro_h */
